<%--
  Created by IntelliJ IDEA.
  User: Jovi
  Date: 2018/3/27
  Time: 下午4:23
  To change this template use File | Settings | File Templates.
--%>
<%@page import="com.pb.news.entity.News" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<link type="text/css" rel="stylesheet" href="../../css/common.css"/>
<jsp:useBean id="newsService"
             class="com.pb.news.service.impl.NewsServiceImpl" scope="page"></jsp:useBean>
<jsp:useBean id="newsDao" class="com.pb.news.dao.impl.NewsDaoImpl"
             scope="page"></jsp:useBean>
<%--setProperty中name是指给哪个对象赋值，property是指给对象的哪个属性赋值，value是指赋值是多少 --%>
<jsp:setProperty property="newsDao" name="newsService"
                 value="<%=newsDao%>"/>
<link href="../css/common.css" rel="stylesheet" type="text/css">
<%
    String id = request.getParameter("id");
    News news = newsService.getNewsById(Integer.parseInt(id));
    request.setAttribute("news", news);
%>
传过来的ID值：${param.id}
<div class="main-text-box">
    <div class="main-text-box-tbg">
        <div class="main-text-box-bbg">
            <div class="article-box">
                <h1><%-- <%=news.getTitle()%> --%><%-- ${news.title} --%>${requestScope.news["title"]}</h1>
                <div class="source-bar">
                    发布者：<%=news.getAuthor()%>分类：新闻信息 更新时间：<%-- <%=news.getCreateDate()%> --%>${news["createDate"]}</div>
                <div class="article-content">
                    <span class="article-summary"><b>摘要：<%=news.getSummary()%></b></span>
                    <img
                            src="<%=request.getContextPath()%>/upload/<%=news.getPicPath()%>"><br/>
                    <%=news.getContent()%>
                </div>
            </div>
        </div>
    </div>
</div>

